<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateSuppliersTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('suppliers', function (Blueprint $table) {
            $table->id();
            $table->string('name')->comment("名称");
            $table->string('logo',100)->comment('LOGO');
            $table->string('register_capital')->comment("注册资金");
            $table->string('register_address')->comment("注册地址");
            $table->string('production_address')->comment('生产地址');
            $table->text('description')->comment("简介")->nullable();
            $table->tinyInteger("category")->default(0)->comment("别：0超级供货商 1普通供货商 ");
            $table->unsignedInteger('users_id')->comment("用户id暂时未用");
            $table->string('username')->comment("登录名");
            $table->string('password')->comment("登录密码");
            $table->string('phone',25)->nullable();
            $table->unsignedInteger('pid')->comment("父级ID，0为超级供货商 ");
            $table->tinyInteger("status")->default(0)->comment("是否禁用状态 0否，1是");
            $table->char('last_login_ip')->nullable()->comment("登陆ip");
            $table->dateTime('last_login_time')->nullable()->comment("登陆时间");
            $table->char('last_session')->nullable()->comment("登陆session");
            $table->timestamps();
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('suppliers');
    }
}
